﻿
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="col-md-6 col-xs-12 col-md-offset-3">
    <h2>User Picture</h2>

    <form method="post" enctype="multipart/form-data" asp-controller="Picture" asp-action="Post">

        @if (ViewData["picture"] != null)
        {
            <div class="form-group">
                <img src="~/avatars/@ViewData["picture"]" style="width: 100%;"/>
            </div>
        }

        <div class="form-group">
            <label for="file">Upload your picture:</label>
            <input type="file" name="file" class="form-control" id="file" />
        </div>
        <input type="submit" value="Upload" class="btn btn-default" />
    </form>
</div>